// file: desktop/icon.h
// autor: jiangxinpeng
// time: 2022.6.8
// copyright: 2020-2050 by jiangxinpeng,All right are reserved.

#ifndef _APP_DESKTOP_ICON_H
#define _APP_DESKTOP_ICON_H

#include <stddef.h>
#include <gui.h>
#include <sys/list.h>

#define ICON_SIZE_DEFAULT 32
#define ICON_BUTTON_SIZE 64
#define ICON_DISTANCE 2

// icon type
#define ICON_TYPE_UNKNOWN 0
#define ICON_TYPE_APP 1
#define ICON_TYPE_LINK 2

#define ICON_CLICK_DISTANCE_MS 500

#define DESKTOP_DIR "/system/desktop"

typedef struct
{
    list_t list;
    int x;
    int y;
    int click_ms;
    gui_spirit_t *button;
    gui_spirit_t *label;
    gui_spirit_t *icon;
    char exec[MAX_PATH_LEN+1];
    bool terminal;
    int type; // icon type
} icon_t;

#endif